package com.leyou.item.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.item.entity.TbBrand;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 品牌表，一个品牌下有多个商品（spu），一对多关系 Mapper 接口
 * </p>
 *
 * @author mybaitsplus
 * @since 2019-10-18
 */
public interface TbBrandMapper extends BaseMapper<TbBrand> {
    @Select("SELECT b.id,b.name,b.letter FROM tb_category_brand cb join tb_brand b" +
            " on " +
            "cb.`brand_id` = b.id AND cb.`category_id` = #{categoryId} ")
     List<TbBrand> selectBrandJoinCategory(Long categoryId);
}
